﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using BrokerBase.Lib.Policy;
using BrokerBase.Lib.Product;

namespace broker.duty.ZY
{
    public class ProductExpander : AbstractProductExpander
    {
        private PolicyTarget pt;
        /// <summary>
        /// 保单加载完成
        /// </summary>
        /// <param name="policy"></param>
        public override void Loaded(IPolicy policy)
        {
            policy.Amount = policy.Owner.BasicPolicy.Amount;


            IPaymentPeriod bpp = policy.Owner.BasicPolicy.SelectedPaymentPeriod;

            policy.SelectedPaymentPeriod = policy.Product.PaymentPeriods.First(p =>p.Value==bpp.Value && p.Style==bpp.Style);

            IInsurancePeriod bip=policy.Owner.BasicPolicy.SelectedInsurancePeriod;

            policy.SelectedInsurancePeriod = policy.Product.InsurancePeriods.First(p => p.Value == bip.Value && p.Style == bip.Style);


        }


    }
}
